<?php if (count($comentario_list)): ?>
<table class="paginacao" cellpadding="2" cellspacing="0" width="100%" align="center">
	<tr>
		<td align="left"><?php $pager_layout->displayResultados(); ?></td>
		<td align="right"><?php $pager_layout->display(); ?></td>
	</tr>
</table>
<?php endif; ?>

<table class="list">
	<thead>
    <tr>
	    <th><?php echo $form['id_comentario']->renderLabel() ?></th>
	    <th><?php echo $form['descricao']->renderLabel() ?></th>
	    <th><?php echo $form['data_comentario']->renderLabel() ?></th>
	    <th><?php echo $form['status']->renderLabel() ?></th>
	    <th><?php echo $form['id_midia']->renderLabel() ?></th>
	    <th><?php echo $form['id_evento']->renderLabel() ?></th>
		<th>Ações</th>
    </tr>
	</thead>
  	<tbody>
  	<?php if (!count($comentario_list)): ?>
	<tr>
		<td align="center" colspan="7">NENHUM REGISTRO ENCONTRADO!</td>
	</tr>
	<?php endif; ?>
	<?php $i = 0; ?>
    <?php foreach ($comentario_list as $comentario): ?>
    <?php $bg = ($i++ % 2 == 0)? 'row0' : 'row1'; ?>
    <tr class="<?php echo $bg; ?>">
	    <td><a href="<?php echo url_for('comentario/show?id_comentario='.$comentario['id_comentario']) ?>"><?php echo $comentario['id_comentario'] ?></a></td>
	    <td><?php echo $comentario['descricao'] ?></td>
	    <td><?php echo $comentario['data_comentario'] ?></td>
	    <td><?php echo $comentario['status'] ?></td>
	    <td><?php echo $comentario['Midia']['legenda'] ?></td>
	    <td><?php echo $comentario['Evento']['nome'] ?></td>
		<td>
			<?php
	            echo link_to(
	                ' ',
	                url_for('comentario/show?id_comentario='.$comentario['id_comentario']),
	                array('class'=>'icoVisualizar','title'=>'Visualizar comentario')
	            )
	        ?>
            <?php
	            echo link_to(
	                ' ',
	                url_for('comentario/edit?id_comentario='.$comentario['id_comentario']),
	                array('class'=>'icoEditar','title'=>'Editar comentario')
	            )
	        ?>
    		<?php
	            echo link_to(
	                ' ',
	                url_for('comentario/delete?id_comentario='.$comentario['id_comentario']),
	                array('class'=>'icoExcluir','title'=>'Excluir comentario', 'confirm' => 'Tem certeza que deseja Excluir?')
	            )
	        ?>
		</td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>